package cn.zcy.test;


import config.SpringConfiguration;
import config.JDBCConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.sql.DataSource;

public class SpringTestImport {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ac=new AnnotationConfigApplicationContext(SpringConfiguration.class);
//        DataSource dateSource = ac.getBean("dateSource", DataSource.class);
//        System.out.println("dateSource = " + dateSource);
//        JDBCConfig bean = ac.getBean(JDBCConfig.class);
//        System.out.println("bean = " + bean);
//        UserService bean = ac.getBean("cn.zcy.service.impl.UserServiceImpl", UserService.class);
        DataSource beana= ac.getBean("dateSource", DataSource.class);
        System.out.println("beana = " + beana);
//        bean.save();
        JDBCConfig bean = ac.getBean("config.JDBCConfig", JDBCConfig.class);
        System.out.println("bean = " + bean);
    }
}
